<?php
/* Smarty version 3.1.31, created on 2018-06-07 01:24:47
  from "D:\wamp64\www\wanju\views\user\contract.html" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.31',
  'unifunc' => 'content_5b1818df6c3962_39646361',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '9a6a051d83f9f4866cb75fecb72f2e6f802d60b4' => 
    array (
      0 => 'D:\\wamp64\\www\\wanju\\views\\user\\contract.html',
      1 => 1528215236,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5b1818df6c3962_39646361 (Smarty_Internal_Template $_smarty_tpl) {
?>

  <div class="x_panel">
    <div class="x_content" style="display: block;">
      <!--表格主体内容-->
      <div class="nav navbar-right panel_toolbox">
        <a class="fa fa-plus" href="/user/add-contract.html">添加合同</a>
      </div>
      <br><br>
      <div class="cont">
        <table class="table table-bordered table-striped">
          <thead>
          <tr>
            <th width="100px">序号</th>
            <th>商家名称（点击编辑店主合同）</th>
            <th>店主账号</th>
            <th>店主合同开始时间</th>
            <th>店主合同结束时间</th>
            <th>店主合同创建时间</th>
            <th>店主合同状态</th>
            <th>店长（点击编辑店长合同）</th>
          </tr>
          </thead>
          <tbody>
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['contract']->value['lists'], 'contractitem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['contractitem']->value) {
?>
          <tr>
            <td><?php echo $_smarty_tpl->tpl_vars['contractitem']->value['shop_id'];?>
</a></td>
            <td><a href="<?php $_template = new Smarty_Internal_Template('eval:'.U(array('user/edit-owner-contract','shop_id'=>$_smarty_tpl->tpl_vars['contractitem']->value['shop_id'])), $_smarty_tpl->smarty, $_smarty_tpl);echo $_template->fetch(); ?>"><?php echo $_smarty_tpl->tpl_vars['contractitem']->value['shop_name'];?>
</a></td>
            <td><?php echo $_smarty_tpl->tpl_vars['contractitem']->value['owner_phone'];?>
</td>
            <td><?php if ($_smarty_tpl->tpl_vars['contractitem']->value['contract_start_time']) {
echo date('Y-m-d',strtotime($_smarty_tpl->tpl_vars['contractitem']->value['contract_start_time']));
}?></td>
            <td><?php if ($_smarty_tpl->tpl_vars['contractitem']->value['contract_end_time']) {
echo date('Y-m-d',strtotime($_smarty_tpl->tpl_vars['contractitem']->value['contract_end_time']));
}?></td>
            <td><?php if ($_smarty_tpl->tpl_vars['contractitem']->value['contract_create_time']) {
echo $_smarty_tpl->tpl_vars['contractitem']->value['contract_create_time'];
}?></td>
            <td><?php if ($_smarty_tpl->tpl_vars['contractitem']->value['contract_start_time'] > date('Y-m-d H:i:s')) {?>未开始<?php } elseif ($_smarty_tpl->tpl_vars['contractitem']->value['contract_start_time'] <= date('Y-m-d H:i:s') && date('Y-m-d H:i:s') <= $_smarty_tpl->tpl_vars['contractitem']->value['contract_end_time']) {?>进行中<?php } elseif (date('Y-m-d H:i:s') > $_smarty_tpl->tpl_vars['contractitem']->value['contract_end_time'] && $_smarty_tpl->tpl_vars['contractitem']->value['contract_end_time']) {?>已过期<?php } else { ?>暂无<?php }?></td>
            <td>
              <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['contractitem']->value['manager'], 'manageritem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['manageritem']->value) {
?>
              <a href="<?php $_template = new Smarty_Internal_Template('eval:'.U(array('user/edit-manager','user_id'=>$_smarty_tpl->tpl_vars['manageritem']->value['user_id'])), $_smarty_tpl->smarty, $_smarty_tpl);echo $_template->fetch(); ?>"><?php echo $_smarty_tpl->tpl_vars['manageritem']->value['phone'];?>
</a>
              <button class="btn btn-danger btn-xs" data-toggle="dropdown">删除店长
                <i class="icon-angle-down"></i></button>
              <ul class="dropdown-menu">
                <li><a href="<?php $_template = new Smarty_Internal_Template('eval:'.U(array('user/del-manager','user_id'=>$_smarty_tpl->tpl_vars['manageritem']->value['user_id'])), $_smarty_tpl->smarty, $_smarty_tpl);echo $_template->fetch(); ?>">确定</a></li>
                <li><a href="javascript:;">取消</a></li>
              </ul><br/>
              <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>

            </td>
          </tr>
          <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>

          </tbody>
        </table>
        <!--分页-->

        <?php echo Yii::$app->view->render('/com/pager.php',array('pager'=>$_smarty_tpl->tpl_vars['contract']->value['pager']));?>

      </div>
    </div>
  </div>

<?php }
}
